package com.fxp.project.jiuselu.web.models.payimage.service.impl;

import java.util.List;

import com.fxp.project.jiuselu.commons.utils.DateUtils;
import com.fxp.project.jiuselu.web.models.payimage.entity.PayImg;
import com.fxp.project.jiuselu.web.models.payimage.mapper.PayImgMapper;
import com.fxp.project.jiuselu.web.models.payimage.service.IPayImgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 订单付款凭证Service业务层处理
 *
 * @author Jason.Wang
 * @date 2022-05-23
 */
@Service
public class PayImgServiceImpl implements IPayImgService
{
    @Autowired
    private PayImgMapper payImgMapper;

    /**
     * 查询订单付款凭证
     *
     * @param id 订单付款凭证主键
     * @return 订单付款凭证
     */
    @Override
    public PayImg selectPayImgById(Long id)
    {
        return payImgMapper.selectPayImgById(id);
    }

    /**
     * 查询订单付款凭证列表
     *
     * @param payImg 订单付款凭证
     * @return 订单付款凭证
     */
    @Override
    public List<PayImg> selectPayImgList(PayImg payImg)
    {
        return payImgMapper.selectPayImgList(payImg);
    }

    /**
     * 新增订单付款凭证
     *
     * @param payImg 订单付款凭证
     * @return 结果
     */
    @Override
    public int insertPayImg(PayImg payImg)
    {
        payImg.setCreateTime(DateUtils.getNowDate());
        return payImgMapper.insertPayImg(payImg);
    }

    /**
     * 修改订单付款凭证
     *
     * @param payImg 订单付款凭证
     * @return 结果
     */
    @Override
    public int updatePayImg(PayImg payImg)
    {
        payImg.setUpdateTime(DateUtils.getNowDate());
        return payImgMapper.updatePayImg(payImg);
    }

    /**
     * 批量删除订单付款凭证
     *
     * @param ids 需要删除的订单付款凭证主键
     * @return 结果
     */
    @Override
    public int deletePayImgByIds(Long[] ids)
    {
        return payImgMapper.deletePayImgByIds(ids);
    }

    /**
     * 删除订单付款凭证信息
     *
     * @param id 订单付款凭证主键
     * @return 结果
     */
    @Override
    public int deletePayImgById(Long id)
    {
        return payImgMapper.deletePayImgById(id);
    }
}
